---
title: "Accessibility Checker Rule Help: combobox_haspopup"
---
import "../../../styles/ToolHelp.scss"
import { CodeSnippet, Tag } from "carbon-components-react";

<div className="toolHelp">
<Row>
<Column colLg={16} colMd={8} colSm={4} className="toolHead">

### The value of the combobox `aria-haspopup` attribute is invalid or does not have a valid reference to the related popup

<div id="locLevel"></div>

The combobox attribute 'aria-haspopup' value must be appropriate for the role of the element referenced by `aria-controls` (WAI-ARIA 1.2) or `aria-owns` (WAI-ARIA 1.0)

</Column>
</Row>
<Row>
<Column colLg={11} colMd={5} colSm={4} className="toolMain">

### Why is this important?

An element with `role="combobox"` may have a popup element with the role of "listbox", "tree", "grid", or "dialog".
If the value for the `aria-haspopup` attribute does not match the value for the popup element's `role` 
attribute, people who use assistive technologies may see unexpected behavior and will not know how 
to interact with the content.

<div id="locSnippet"></div>

### What to do

 * Set the value of the `aria-haspopup` attribute of the combobox element to match the value of the `role` attribute of the implemented popup. Allowed popup element `role` attribute values are "listbox", "tree", "grid", or "dialog".

Alert: The guidance for combobox is changing significantly in WAI-ARIA 1.2 due to problems with implementation of the WAI-ARIA 1.1 pattern. The recommended combobox pattern for WAI-ARIA 1.2 is:

<CodeSnippet type="multi" light={true}> &lt;label for="tag_combo"&gt;Tag&lt;/label&gt;
  &lt;input type="text" id="tag_combo"
      role="combobox" aria-autocomplete="list"
      aria-haspopup="listbox" aria-expanded="true"
      aria-controls="popup_listbox" aria-activedescendant="selected_option"&gt;
   &lt;ul role="listbox" id="popup_listbox"&gt;
      &lt;li role="option"&gt;Zebra&lt;/li&gt;
      &lt;li role="option" id="selected_option"&gt;Zoom&lt;/li&gt;
   &lt;/ul&gt;</CodeSnippet>

Note, example code includes material copied from or derived from [W3C, Accessible Rich Internet Applications (WAI-ARIA) 1.2 W3C Working Draft 18 December 2019](https://www.w3.org/TR/wai-aria-1.2/#combobox). Copyright © [2013-2019] W3C® (MIT, ERCIM, Keio, Beihang).

</Column>
<Column colLg={5} colMd={3} colSm={4} className="toolLeft">

### About this requirement

[IBM 4.1.2 Name, Role, Value](https://www.ibm.com/able/requirements/requirements/#4_1_2)
[W3C WAI-ARIA v1.2 Authoring Practices - Combobox](https://www.w3.org/TR/wai-aria-1.2/#combobox)

### Who does this affect?

 * People using screen readers

</Column>
</Row>
</div>

export default ({ children, _frontmatter }) => (<React.Fragment>{children}</React.Fragment>)
